package Practice1;

import java.io.IOException;
import java.io.OutputStream;
import java.net.*;
import java.util.Scanner;

public class client {
    public static void main(String[] args) throws IOException {
        /*
        * 实现多发多送 192.168.43.82
        * */
        Socket socket = new Socket("192.168.43.82",10086); // 创建socket对象
        OutputStream os = socket.getOutputStream();// 从通道中获取输出流
        Scanner sc = new Scanner(System.in);

        while (true) {
            System.out.println("请输入你要发送的信息");
            String str = sc.nextLine();
            if(str.equals("886")){
                break;
            }
            os.write(str.getBytes());
        }

        // 释放资源
        socket.close();

    }
}
